<?php

$this->breadcrumbs = array(
    'Ruang Rapat' => $this->createUrl('/' . $this->module->id . '/front/index'),
    'My Booking History',
);

$this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'history-grid',
    'dataProvider' => $dataProvider,
    'filter' => $model,
    'columns' => array(
        array(
            'header' => 'Rapat Id',
            'name' => 'id',
        ),
        array(
            'header' => 'Meeting Name',
            'name' => 'name',
        ),
        'date',
        'time_start',
        'time_end',
        'participant',
        array(
            'header' => 'Meeting Room',
            'filter' => CHtml::activeTextField($model, 'room_name'),
            'name' => 'room.name',
        ),
        'message',
        'status',
        array(
            'class' => 'CButtonColumn',
            'header' => 'Action',
            'template' => '{view}{update}{delete}',
            'buttons' => array(
                'delete' => array(
                    'label' => 'Cancel',
                    'visible' => '$data->status=="waiting"',
                ),
                'update' => array(
                    'visible' => '$data->status=="waiting"',
                ),
            ),
        )
    )
    ));
?>
<script type="text/javascript">
    setInterval(function(){
        $.fn.yiiGridView.update('history-grid');
    }, 10000);
</script>
